import request from "@/utils/request";
import { User, LoginForm } from "@/entity/User";

// 登录
export const login = (data: LoginForm) =>
  request<string>({
    url: "/user/login",
    method: "post",
    data,
  });

// 退出登录
export const logout = () =>
  request<string>({
    url: "/user/logout",
    method: "get",
  });

// 获取用户信息
export const getUserInfo = () =>
  request<User>({
    url: "/user/getUserInfo",
    method: "get",
  });

// 修改用户
export const modifyUser = (data: User) =>
  request<string>({
    url: "/user/modifyUser",
    method: "post",
    data,
  });
